<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>攀枝花学院JSON</title>
    <script type="text/javascript">
        var str = "https://image.baidu.com/search/index?tn=baiduimage&ps=1&ct=201326592&lm=-1&cl=2&nc=1&ie=utf-8&dyTabStr=MCw2LDMsMSw0LDUsMiw3LDgsOQ%3D%3D&word=%E6%94%80%E6%9E%9D%E8%8A%B1%E5%AD%A6%E9%99%A2";
        var index = str.indexOf("?");
        var paramstr = str.substring(index + 1);
        var params = paramstr.split("&");
        var obj = {};
        for (var i = 0; i < params.length; i++) {
            var name = params[i].split("=")[0];
            obj[name] = decodeURI(params[i].split("=")[1]);
        }

        console.log(params);
        console.log(obj);
    </script>
</head>
<body>
</body>
</html>